package com.zhumei.keyscale.receiver;

import android.content.*;
import com.zhumei.keyscale.ui.*;

public class MyReceiver extends BroadcastReceiver
{
    public void onReceive(final Context context, Intent intent) {
        final String action = intent.getAction();
        final String packageName = context.getPackageName();
        final String schemeSpecificPart = intent.getData().getSchemeSpecificPart();
        if ((action.equals("android.intent.action.PACKAGE_ADDED") || action.equals("android.intent.action.PACKAGE_REPLACED")) && schemeSpecificPart.equals(packageName)) {
            intent = new Intent(context, (Class)MainActivity.class);
            intent.setFlags(268435456);
            context.startActivity(intent);
        }
    }
}
